www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\Rss.asp

    <!--#include file="inc.asp"--><%
checklg()
'if userlg=false then response.end
url=Lcase(url)
url=replace(url,"rss","Showbbs")
dim action,sql,wzrep,hostname,reinfo,urlstr,rename,topicinfo,retopic,description,linkstr,userid,category,username

wzrep=application(prefix&"topiclistpage")
action=request.querystring("action")
hostname=Request.ServerVariables("SERVER_NAME")
userid=checknum(request.querystring("userid"))
bbsname=checktitle(bbsname)


if bd>0 then
	category=checktitle(bdinfo(0))
end if

if action="today" then
	category="今日新贴"
end if

if userid>0 then
	set rs=conn.execute("select top 1 name from [user] where userid="&userid&"")
		if not rs.eof then category=rs("name")&"空间"
	set rs=nothing
end if


for each rename in request.querystring
	urlstr=urlstr&rename&"="&request.querystring(rename)&"&"
next

urlstr="?"&urlstr
urlstr=left(urlstr,len(urlstr)-1)
urlstr=checktitle(urlstr)
Response.ContentType="text/xml"
%><?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
	<channel>
		<title><%response.write bbsname&"→"&category%></title> 
		<link><%response.write "http://"&hostname&url&urlstr%></link> 
		<description><%response.write bbsname&"→"&category%></description> 
		<copyright>www.6kbbs.net</copyright> 
		<generator>Powered By : 6kbbs V 7.1</generator> 
<%
'_____________________________________________________________________________________________________________________________________________


if action="good" then
	sql="select*from topic where bd="&bd&" and type=1 order by top desc,edittime desc"
elseif action="today" then
	sql="select*from topic where edittime>now()+"&timeset&"/24-1 and type<>3 order by edittime desc"
else
	sql="select*from topic where bd="&bd&" and type<>3 order by top desc,edittime desc"
end if


if userid>0 then sql="select*from topic where userid="&userid&" and type<>3 order by top desc,edittime desc"

set rs = server.createobject("adodb.recordset")
	rs.Open sql,conn,1
	
		if rs.eof or rs.bof then
			response.write"		<item></item>"&VbNewline

		else
			'wzcount=rs.recordcount
			
			'wzpagecount = abs(int(-abs(wzcount/wzrep)))
			'if len(wzpage) = 0 or wzpage = 0 then wzpage = 1
			'rs.absoluteposition=rs.absoluteposition+((abs(wzpage)-1)*wzrep)


			for i = 0 to wzrep-1
			
			
				if rs.eof then exit for
					response.write"		<item>"&VbNewline	'帖子开始///////////////////////////////////////////////////////////
				
				topicinfo=rs("topicinfo")
				topicinfo=split(topicinfo,"|")
				retopic=rs("retopic")
				if isnull(retopic) or retopic="" then
					reinfo="——"
					retopic="未有人回复。|——|0"
					retopic=split(retopic,"|")
				else
					retopic=split(retopic,"|")
					reinfo=checktitle(retopic(1))
				end if
				
				description="最后回复:"&checktitle(retopic(0))&""
				linkstr="http://"&hostname&""&url&"?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")
				linkstr=checktitle(linkstr)
				
				response.write"			<title>"&checktitle(topicinfo(1))&"</title>"&VbNewline
				response.write"			<link>"&linkstr&"</link>"&VbNewline
				response.write"			<description><![CDATA[ "&description&" ]]></description>"&VbNewline
				response.write"			<category>"&category&"</category>"&VbNewline
				response.write"			<author>"&checktitle(topicinfo(2))&"</author>"&VbNewline
				response.write"			<pubDate>"&rs("edittime")&"</pubDate>"&VbNewline
				
					response.write"		</item>"&VbNewline	''帖子结束///////////////////////////////////////////////////////////
				rs.movenext
			next%><%
		end if
	rs.Close
set rs=nothing
Response.write"	</channel>"&VbNewline
Response.write"</rss>"
%>